package com.web.system.po;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "t_sys_menu")
public class TreeMenuPo implements Serializable{
	
	private static final long serialVersionUID = 2798564610685362266L;
	@Id
	@Column(name = "MENU_ID")
	private String id;
	@Column(name = "MENU_NAME")
	private String menuName;
	@Column(name = "MENU_HREF")
	private String menuHref;
	@Column(name = "MENU_TARGET")
	private String menuTarget;
	@Column(name = "PARENTID")
	private String parentId;
	@Column(name = "iconCls")
	private String iconCls;
	@Column(name = "GRADE")
	private Integer grade;
	@Column(name = "ISLEAF")
	private Integer isLeaf;
	@ManyToMany
	@JoinTable(
	        name="t_sys_role_menu",
	        joinColumns={@JoinColumn(name="menu_id")},
	        inverseJoinColumns={@JoinColumn(name="role_id")}
	)
	@Fetch(value = FetchMode.SELECT)
	@LazyCollection(value = LazyCollectionOption.TRUE)
	private Set<RolePo> roleBeans = new HashSet<RolePo>();
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getMenuName() {
		return menuName;
	}
	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}
	public String getMenuHref() {
		return menuHref;
	}
	public void setMenuHref(String menuHref) {
		this.menuHref = menuHref;
	}
	public String getMenuTarget() {
		return menuTarget;
	}
	public void setMenuTarget(String menuTarget) {
		this.menuTarget = menuTarget;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public Integer getGrade() {
		return grade;
	}
	public void setGrade(Integer grade) {
		this.grade = grade;
	}
	public Integer getIsLeaf() {
		return isLeaf;
	}
	public void setIsLeaf(Integer isLeaf) {
		this.isLeaf = isLeaf;
	}
	public Set<RolePo> getRoleBeans() {
		return roleBeans;
	}
	public void setRoleBeans(Set<RolePo> roleBeans) {
		this.roleBeans = roleBeans;
	}
	
}
